package cn.frank.framework.king.conf.init.listener;

import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;

/**
 * @description: TODO
 * @author: renjiangyang
 * @date 2025/7/31 11:24:47
 * @since 1.8
 */
// ✅ 应用已就绪，可对外提供服务或进行后续逻辑
public class ApplicationReadyListener implements ApplicationListener<ApplicationReadyEvent> {

    /**
     * 1. ApplicationStartingEvent
     * 2. ApplicationEnvironmentPreparedEvent
     * 3. ApplicationContextInitializedEvent
     * 4. ApplicationPreparedEvent
     * 5. ContextRefreshedEvent
     * 6. ApplicationStartedEvent
     * 7. ✅  ApplicationReadyEvent             <-- 你监听的就是这个
     */
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        System.out.println(" [4] Spring Boot 应用已完全启动完毕");
    }
}